<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/_AFragment :: head(~{::title})">
    <meta charset="UTF-8">
    <title>学生信息管理</title>
    <link rel="stylesheet" href="../../static/layui/css/layui.css">
    <link rel="stylesheet" href="../../static/css/main.css">
    <script src="../../static/layui/layui.js"></script>
</head>
<body>
<!--头部导航部分-->
<div class="header" th:replace="admin/_AFragment :: topmenu">
    <div class="layui-col-md10">
        <span id="header-font">贫困生资助系统</span>
    </div>
    <ul class="layui-nav layui-col-md2">
        <li class="layui-nav-item" style="float: right">
            <a href=""><img src="//t.cn/RCzsdCq" class="layui-nav-img">我</a>
            <dl class="layui-nav-child">
                <dd><a href="javascript:;">修改信息</a></dd>
                <dd><a href="javascript:;">安全管理</a></dd>
                <dd><a href="javascript:;">退了</a></dd>
            </dl>
        </li>
    </ul>
</div>
<!--主要内容部分-->
<div class="layui-row">
    <!--左侧导航-->
    <ul th:replace="admin/_AFragment :: leftmenu(3)" class="layui-nav layui-nav-tree  layui-col-md2" lay-filter="demo" style="height: 662px">
        <li class="layui-nav-item layui-nav-itemed">
            <a href="javascript:;"><i class="layui-icon">&#xe770;</i> 个人中心</a>
            <dl class="layui-nav-child">
                <dd><a href="javascript:;">主页</a></dd>
                <dd><a href="javascript:;">用户信息</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item layui-this"><a href="#"><i class="layui-icon">&#xe66f;</i> 学生信息</a></li>
        <li class="layui-nav-item">
            <a href="javascript:;"><i class="layui-icon">&#xe6b2;</i> 经济困难认定</a>
            <dl class="layui-nav-child">
                <dd><a href="javascript:;">经济困难认定</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item">
            <a href="javascript:;"><i class="layui-icon">&#xe857;</i> 资助管理</a>
            <dl class="layui-nav-child">
                <dd><a href="javascript:;">资源管理</a></dd>
                <dd><a href="javascript:;">资助申请审核</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item">
            <a href="javascript:;"><i class="layui-icon">&#xe631;</i> 系统管理</a>
            <dl class="layui-nav-child">
                <dd><a href="javascript:;">修改密码</a></dd>
            </dl>
        </li>
    </ul>
    <!--右侧内容-->
    <div class="layui-col-md10">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>学生信息管理</legend>
        </fieldset>
        <!--表格-->
        <div class="demoTable" style="margin-left: 5px">
            学号：
            <div class="layui-inline">
                <input class="layui-input" name="studentNumber" id="studentNumber" autocomplete="off">
            </div>
            姓名：
            <div class="layui-inline">
                <input class="layui-input" name="studentName" id="studentName" autocomplete="off">
            </div>
            <button class="layui-btn" data-type="reload">搜索</button>
        </div>
        <table class="layui-hide" id="student"></table>
    </div>
</div>

<script type="text/html" id="specialOad">
    <span>{{d.specialOad?'是':'否'}}</span>
</script>
<script type="text/html" id="specialSp">
    <span>{{d.specialSp?'是':'否'}}</span>
</script>
<script type="text/html" id="specialCom">
    <span>{{d.specialCom?'是':'否'}}</span>
</script>
<script type="text/html" id="specialFo">
    <span>{{d.specialFo?'是':'否'}}</span>
</script>
<script type="text/html" id="specialSa">
    <span>{{d.specialSa?'是':'否'}}</span>
</script>

</body>


<script>
    layui.use('element', function(){
    });
    layui.use('form', function(){
    });
    layui.use('table', function(){
        var table = layui.table;
        table.render({
            elem: '#student'
            ,url:'/teacher/studentList'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [ [
                {field:'studentName', title: '姓名'}
                ,{field:'studentSex', title: '性别', sort: true}
                ,{field:'studentNumber', title: '学号', sort: true}
                ,{field:'studentCardid', title: '身份证', sort: true}
                ,{field:'studentYear', title: '入学年份', sort: true}
                ,{field:'studentEducation', title: '学历', sort: true}
                ,{field:'studentDepartment', title: '院系', sort: true}
                ,{field:'studentPopulation', title: '家庭人口', sort: true}
                ,{field:'studentRes', title: '户口', sort: true}
                ,{field:'specialOad', title: '孤残', sort: true ,templet: '#specialOad'}
                ,{field:'specialSp', title: '单亲', sort: true,templet: '#specialSp'}
                ,{field:'specialCom', title: '烈士子女', sort: true,templet: '#specialCom'}
                ,{field:'specialFo', title: '优抚对象', sort: true,templet: '#specialFo'}
                ,{field:'specialSa', title: '低保家庭', sort: true,templet: '#specialSa'}
            ] ]
            ,id:'tableReload'
            ,page:true
        });

        var $ = layui.$, active = {
            reload: function(){
                var studentNumber = $('#studentNumber');
                var studentName = $('#studentName');
                //执行重载
                table.reload('tableReload', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    ,where: {
                        key: {
                            studentNumber: studentNumber.val(),
                            studentName: studentName.val()
                        }
                    }
                }, 'data');
            }
        };
        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
    //弹出消息
    layui.use('layer', function(){
        var layer = layui.layer;
        var msg = "[[${msg}]]";
        if (msg!=null&&msg!=""){
            layer.msg(msg);
        }
    });
</script>
</html>